package com.lance.answer.gui.answer.gk.answer.lms.batch;


import com.google.common.base.Strings;
import com.google.common.collect.Lists;
import com.lance.answer.gui.answer.gk.answer.lms.batch.dto.LmsWatchDTO;
import com.lance.answer.gui.answer.gk.answer.lms.batch.task.GetUserCourseInfoByJsonTask;
import org.apache.commons.io.IOUtils;

import java.io.File;
import java.io.FileInputStream;
import java.io.InputStream;
import java.nio.charset.StandardCharsets;
import java.util.List;
import java.util.concurrent.LinkedBlockingDeque;

/**
 * 获取学生的信息
 */
public class FindUnRegStudent {

    public static void main(String[] args) throws Exception {


        InputStream inputStream2 = new FileInputStream("libs//2022秋//teacher//阿迪力.user");
        List<String> userString = IOUtils.readLines(inputStream2, "utf-8");

        List<String> unReg = Lists.newArrayList();
        for (String user : userString) {
            String[] strs = user.split(",");
            String userCode = strs[0];
            File file = new File("libs//lmsCourseInfo//" + userCode + ".json");
            if(file.exists()){
                String info = IOUtils.toString(new FileInputStream(file), StandardCharsets.UTF_8);
                if (!Strings.isNullOrEmpty(info)&&info.length()>10) {
                    continue;
                }else {
                    unReg.add(userCode);
                }
            }else {
                unReg.add(userCode);
            }



        }

        System.err.println(unReg.size());

        for(String s:unReg){
            System.err.println(s);
        }



    }

}
